package com.woniuxy.carrental.zqqmapper;

import com.woniuxy.carrental.entity.DispatchCar;
import com.woniuxy.carrental.entity.Store;
import com.woniuxy.carrental.mapper.DispatchCarMapper;
import com.woniuxy.carrental.mapper.StoreMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;
import java.util.List;

/**
 * @author author
 * @create 2021-09-28 13:52
 */


@SpringBootTest
public class TsetDispatchCarMapper {

    @Autowired
    DispatchCarMapper dispatchCarMapper;

    @Autowired
    StoreMapper storeMapper;

    @Test
     public void testaadDispatchCar(){

        List<Store> stores = storeMapper.selectStore();
        DispatchCar dispatchCar=new DispatchCar(null
        , "1至2", new Date(), null, 3, null);
        dispatchCar.setStoreto(stores.get(0));
        dispatchCar.setStoreup(stores.get(1));
        System.out.println(dispatchCar);
         dispatchCarMapper.addDispatchCar(dispatchCar);
     }








}
